package com.cgbl.cg.vm.resource

import android.app.Application
import android.os.Bundle
import androidx.databinding.ObservableField
import com.robot.base.base.vm.GLBaseViewModel
import com.robot.base.configs.AppConstants
import com.robot.base.model.FilterBean
import com.robot.base.util.LiveDataEventManager
import com.robot.base.util.arouter.ARouterUtil
import io.reactivex.internal.operators.observable.ObservableFilter
import me.goldze.mvvmhabit.binding.command.BindingAction
import me.goldze.mvvmhabit.binding.command.BindingCommand
import me.goldze.mvvmhabit.bus.event.SingleLiveEvent

class FilterResourceViewModel(application: Application) : GLBaseViewModel(application) {
    var finishType = false
    val priceList = arrayListOf("免费", "VIP")

    val sidesList = arrayListOf("5K以下", "5K-10K", "10K-30K", "100K以上", "20K-100K")

    val wiringList = arrayListOf("三角形", "四边形", "N边形", "三角形+四边形", "面片")

    val formatList = arrayListOf(
        "3ds Max(.max)",
        "Blender(.blend)",
        "UE4Enginesketchup(.skp)",
        "OBJ(.obj)",
        "Maya(.ma)",
        "Zbrush(.ztl)",
        "Unity Engine"
    )

    var minPrice = ObservableField("")
    var maxPrice = ObservableField("")

    var price = ""
    var sides = ""
    var wiring = ""
    var format = ""

    val uc = UiChangeEvent()

    class UiChangeEvent {
        val cancelEvent = SingleLiveEvent<Void>()
        val confirmEvent = SingleLiveEvent<Void>()
    }

    val confirmCommand = BindingCommand<Any>(BindingAction {
        uc.confirmEvent.call()
    })

    val cancelCommand = BindingCommand<Any>(BindingAction {
        uc.cancelEvent.call()
    })
}